package com.mcx.modules.data.localdata.create;

import com.mcx.modules.data.GameDataTableParser;
import com.mcx.modules.data.base.AbstractDBModel;

/** GameLevelGrade数据管理 */
public class GameLevelGradeDBModel extends AbstractDBModel<GameLevelGradeDBModel, GameLevelGradeEntity>
{
    private static GameLevelGradeDBModel instance;

    public static GameLevelGradeDBModel getInstance() {
        if (instance == null) {
            instance = new GameLevelGradeDBModel();
        }
        return instance;
    }

    /** 文件名称 */
    @Override
    protected String FileName() {
        return "GameLevelGrade.data";
    }

    /** 创建实体 */
    @Override
    protected GameLevelGradeEntity MakeEntity(GameDataTableParser parse)
    {
        GameLevelGradeEntity entity = new GameLevelGradeEntity();
        entity.Id = parse.GetFieldValueToInt("Id");
        entity.GameLevelId = parse.GetFieldValueToInt("GameLevelId");
        entity.Grade = parse.GetFieldValueToInt("Grade");
        entity.Desc = parse.GetFieldValueToUTF8String("Desc");
        entity.Type = parse.GetFieldValueToInt("Type");
        entity.Parameter = parse.GetFieldValueToUTF8String("Parameter");
        entity.ConditionDesc = parse.GetFieldValueToUTF8String("ConditionDesc");
        entity.Exp = parse.GetFieldValueToInt("Exp");
        entity.Gold = parse.GetFieldValueToInt("Gold");
        entity.CommendFighting = parse.GetFieldValueToInt("CommendFighting");
        entity.TimeLimit = parse.GetFieldValueToFloat("TimeLimit");
        entity.Star1 = parse.GetFieldValueToFloat("Star1");
        entity.Star2 = parse.GetFieldValueToFloat("Star2");
        entity.Equip = parse.GetFieldValueToUTF8String("Equip");
        entity.Item = parse.GetFieldValueToUTF8String("Item");
        entity.Material = parse.GetFieldValueToUTF8String("Material");
        return entity;
    }
}
